import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:jinke/utils/util.dart';

import '../index.dart';

/// hello
class ProTitleWidget extends GetView<ProDetailController> {
  const ProTitleWidget({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    var state = controller.state;
    return GetBuilder<ProDetailController>(
      builder: (ctx) => Container(
        height: 92.r,
        padding: EdgeInsets.only(left: 20.r,right: 20.r),
        color: Colors.white,
        child: Row(
          children: [
            Image.asset(
              'icon_pro.png'.imgPathProList,
              width: 60.r,
              height: 60.r,
            ),
            SizedBox(width: 10.r,),
            Expanded(
              child: Container(
                alignment: Alignment.centerLeft,
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                  children: [
                    Flexible(
                      child: Text(
                        state.detailMod?.projectName ?? '',
                        style: TextStyle(
                          color: ColorsUtil.title,
                          fontSize: 16.sp,
                          fontWeight: FontWeight.bold,
                        ),
                      ),
                    ),
                    Row(
                      children: [
                        Container(
                          decoration: BoxDecoration(
                            color: const Color(0xffEF7F13).withAlpha(30),
                            borderRadius: BorderRadius.circular(2.r),
                          ),
                          padding: EdgeInsets.symmetric(
                              horizontal: 5.r, vertical: 2.r),
                          child: Text(
                            '重大项目',
                            style: TextStyle(
                                color: const Color(0xffEF7F13),
                                fontSize: 10.sp),
                          ),
                        ),
                        SizedBox(
                          width: 4.r,
                        ),
                        Container(
                          decoration: BoxDecoration(
                            color: const Color(0xffF2F3F7),
                            borderRadius: BorderRadius.circular(2.r),
                          ),
                          padding: EdgeInsets.symmetric(
                              horizontal: 5.r, vertical: 2.r),
                          child: Text(
                            state.mod.phaseName ?? '',
                            style: TextStyle(
                                color: ColorsUtil.subTitle, fontSize: 10.sp),
                          ),
                        ),
                      ],
                    )
                  ],
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}
